import { createRouter, createWebHistory } from 'vue-router';
import Home from '../pages/Home.vue';
import AppNavigation from '../components/AppNavigation.vue';
import AppFooter from '../components/AppFooter.vue';

const routes = [
  {
    name: '全部文章Global-feed',
    path: '/',
    component: Home,
  },
  {
    name: '我的文章my-feed',
    path: '/my-feeds',
    component: Home,
  },
  {
    name: '标签下文章tag',
    path: '/tag/:tag',
    component: Home,
  },
  {    
    name: '文章详情article',
    path: '/article/:slug',
    component: () => import('../pages/Article.vue'),
  },
  {
    name: '更改文章edit-article',
    path: '/article/:slug/edit',
    component: () => import('../pages/EditArticle.vue'),
  },
  {
    name: '新建文章create-article',
    path: '/article/create',
    component: () => import('../pages/EditArticle.vue'),
  },
  {  
    name: '登录login',  
    path: '/login',
    component: () => import('../pages/Login.vue'),
  },
  {       
    name: '注册register',
    path: '/register',
    component: () => import('../pages/Register.vue'),
  },
  {
    name: '个人资料页profile',
    path: '/profile/:username',
    component: () => import('../pages/Profile.vue'),
  },
  {
    name: '个人点赞文章profile-favorites',
    path: '/profile/:username/favorites',
    component: () => import('../pages/Profile.vue'),
  },
  {
    name: '个人设置页settings',
    path: '/settings',
    component: () => import('../pages/Settings.vue'),
  },
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

export default router;